package org.marvec.pisnickar.panels;

import org.marvec.pisnickar.html.HtmlListener;
import org.marvec.pisnickar.songs.SourceManager;
import org.marvec.pisnickar.tabs.TabManipulator;

/**
 *
 * @author marvec
 */
public class SelectionPanel extends SearchPanel {

    public SelectionPanel(TabManipulator manipulator, SourceManager sources, HtmlListener listener) {
        super(sources, manipulator, listener, "Výběr:*", null);
        initComponents();
        initHtmlPanel();
    }

    protected void initHtmlPanel() {
        try {
            this.results = sources.getDummySongSource().search("*");
        } catch (Exception e) {
            // this should not happen with selection
        }
        super.initHtmlPanel(htmlPanel1, listener, results);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        htmlPanel1 = new org.lobobrowser.html.gui.HtmlPanel();

        setName("Form"); // NOI18N

        htmlPanel1.setName("htmlPanel1"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(htmlPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(htmlPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.lobobrowser.html.gui.HtmlPanel htmlPanel1;
    // End of variables declaration//GEN-END:variables

}
